package com.example.jw_web.Servlet;

import com.example.jw_web.Mapper.AddOursDao;
import com.example.jw_web.pojo.Wait_member;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
@Slf4j
public class AddOursServletImpl implements AddOursServlet {

    @Autowired
    AddOursDao addOursDao;

    @Override
    public void saveMembers(Wait_member wait_member) {

        List<String> hobbies = wait_member.getHobby();
        String hobbiesString = String.join(",", hobbies);
        log.info("爱好->转成String形式： "+hobbies);
        addOursDao.saveMembers(wait_member,hobbiesString);
    }
}
